{% with messages = get_flashed_messages(with_categories=true) %}
  {% if messages %}
    <ul class="list-group list-group-horizontal">
    {% for category, message in messages %}
      <li class="list-group-item">{{ message }}</li>
    {% endfor %}
    </ul>
  {% endif %}
{% endwith %}